package com.example.controller;

import com.example.entity.training.TrainingPlanDetail;
import com.example.service.TrainingPlanDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("api/trainingDetail")
public class TrainingPlanDetailController {
    @Autowired
    TrainingPlanDetailService trainingPlanDetailService;

    @RequestMapping(value = "/query", method = RequestMethod.POST)
    public Map<String,Object> query(@RequestBody TrainingPlanDetail trainingPlanDetail){
        return trainingPlanDetailService.query(trainingPlanDetail);
    }

    @RequestMapping(value = "/update", method = RequestMethod.POST)
    public Map<String,Object> update(@RequestBody TrainingPlanDetail trainingPlanDetail){
        return trainingPlanDetailService.update(trainingPlanDetail);
    }

    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public Map<String,Object> delete(@RequestBody Map map){

        return trainingPlanDetailService.delete(map);
    }

    @RequestMapping(value = "/updatePlanStatus", method = RequestMethod.POST)
    public Map<String,Object> updatePlanStatus(@RequestBody Map map){
        return trainingPlanDetailService.updatePlanStatus(map);
    }
    @RequestMapping(value = "/uploadTrainingPhoto", method = RequestMethod.POST)
    public Map<String,Object> uploadTrainingPhoto(@RequestBody  TrainingPlanDetail trainingPlanDetail){
        return trainingPlanDetailService.uploadTrainingPhoto(trainingPlanDetail);
    }

    @RequestMapping(value = "/uploadCheckInTable", method = RequestMethod.POST)
    public Map<String,Object> uploadCheckInTable(@RequestBody TrainingPlanDetail trainingPlanDetail){
        return trainingPlanDetailService.uploadCheckInTable(trainingPlanDetail);
    }

    @RequestMapping(value = "/uploadSummaryStatement", method = RequestMethod.POST)
    public Map<String,Object> uploadSummaryStatement(@RequestBody TrainingPlanDetail trainingPlanDetail){
        return trainingPlanDetailService.uploadSummaryStatement(trainingPlanDetail);
    }
}
